package game.entity;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

import game.ability.AbilityFireUp;
import game.ability.AbilityManager;
import game.helper.ArmyBoundary;
import game.particles.Particle_1;
import game.shared.Constants;

public class Weapon extends AbsSprite{

	AbilityManager abilityManager;
	public Weapon(Weapon weapon){
		super(weapon);
		this.abilityManager = weapon.abilityManager;
	}
	public Weapon(SpriteManager _SpriteManager, String imgPath, int idAnimation, float frameDuration, int num_rows, int num_clus) {
		super(_SpriteManager, imgPath,idAnimation,  frameDuration,  num_rows, num_clus);
	}
	
	public Weapon(SpriteManager _SpriteManager, String imgPath,int idAnimation, float frameDuration, int scrX, int scrY, int frameWidth, int frameHeight, int num_rows, int num_clus) {
		super(_SpriteManager, imgPath,idAnimation,  frameDuration,  scrX, scrY, frameWidth, frameHeight, num_rows, num_clus);
	}	
	
	public Weapon(AbilityManager abilityManager, SpriteManager _SpriteManager, String configueFilePath)
	{
		super(_SpriteManager, configueFilePath);
		this.abilityManager = abilityManager;
	}

	public Weapon(AbsSprite weapon)
	{
		super(weapon);
	}
	
	@Override
	public void update() {
		if(ArmyBoundary.isInsection(this.getBoundingRectangle()))
		{
			abilities.action(Constants.ABILITY_LOSTHP);
			AbilityFireUp abilityFireUp = new AbilityFireUp(this.id);
			abilityFireUp.setPosition((int)this.getX(), (int)this.getY());
			abilityManager.add(abilityFireUp);
			abilityManager.action(this.id);
			this.setHp(0);
		}
		super.update();
	}
}
